from flask import Blueprint, request
from utils.Response import Response
from service import image_generate

sd_bp = Blueprint('sd_bp', import_name=__name__, url_prefix='/stable_diffusion')


@sd_bp.get("")
def text_to_image():
    content = request.args.get('msg', '')
    print(content)
    result = image_generate.image_generate(content)
    return Response.success(data=result)
